<template>
<div>
  <h2>MusicDetail</h2>
  <h1>{{name}}的音乐</h1>
</div>
</template>

<script>
export default {
  name: "index",
  computed:{
    name(){
      const {id} = this.$route.params
      switch (id){
        case '1':
          return '周杰伦'
        case '2':
          return '王力宏'
        case '3':
          return '陈奕迅'
        default :
          return 'xxx'
      }
    }
  },
  mounted() {
    console.log('MusicDetail mounted')
  },
  beforeDestroy() {
    console.log('MusicDetail beforeDestroy')
  }
}
</script>

<style scoped>

</style>